Feature: Problem as symbolic.Environment interface#29
Conversation
…OptimizationProblem pointer into an Environment
There was a problem hiding this comment.
Pull Request Overview
This PR implements the symbolic.Environment interface for the OptimizationProblem type, enabling it to be used wherever a symbolic environment is expected. This change aims to resolve variable substitution issues in the simplex solver.
- Implements three methods (
GetName,TrackVariable,AllTrackedVariables) to satisfy thesymbolic.Environmentinterface - Updates variable creation to associate variables with their environment (
op) - Simplifies variable matrix creation by passing the environment to the constructor
- Updates the SymbolicMath.go dependency to support the new interface requirements
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| problem/optimization_problem.go | Implements symbolic.Environment interface methods and updates variable creation to set Environment field |
| go.mod | Updates SymbolicMath.go dependency to version that supports Environment interface |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #29 +/- ##
==========================================
+ Coverage 86.76% 87.29% +0.52%
==========================================
Files 27 35 +8
Lines 3687 4194 +507
==========================================
+ Hits 3199 3661 +462
- Misses 440 476 +36
- Partials 48 57 +9 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Introducing this new feature which allows the
problem.OptimizationProblempointer anywhere that asymbolic.Environmentinterface is expected. This should resolve the issues that we were seeing in the simplex solver with substituting the wrong variables.